package Pets;

import java.util.Scanner;

abstract public class Pet {
    Scanner imp=new Scanner(System.in);
    private String kind;
    private String name;

    public String getKind() {
        return kind;
    }

    public void setKind(String kind) {
        this.kind = kind;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender() {
        System.out.println("1.雄   2.雌");
        int i=imp.nextInt();
        if(i==1){
            this.gender="雄";
        }else if(i==2){
            this.gender="雌";
        }else{
            System.out.println("请输入正确的性别！");
        }
    }

    public void setGender(int i){
        if(i==1)this.gender="雄";
        else if(i==2)this.gender="雌";
        else {
            System.out.println("请输入正确的编号！已默认此批宠物性别为雄！");
            this.gender="雄";
        }
        return;
    }

    public double getAge() {
        return age;
    }

    public void setAge(double age) {
        this.age = age;
    }

    private String gender;
    private double age;
    private int price;

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }
    private int num;

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }
}
